package com.googlecode.imanager.client.style;

import java.io.Serializable;

/**
 * @author wellsantos@wellsantos.com
 * @since 0.01
 */
public class PageSettings implements Serializable, Cloneable {

    private static final long serialVersionUID = 1L;

    private Orientation orientation;
    
    private int pageWidth;    
    private int pageHeight;
    
    private int marginLeft;
    private int marginTop;
    private int marginRight;
    private int marginBottom;

    private String[] authors;
    private String comments;
    
    public PageSettings() {
        orientation = Orientation.DEFAULT;
        
        pageWidth = 595;
        pageHeight = 842;

        marginLeft = 30;
        marginTop = 30;
        marginRight = 30;
        marginBottom = 30;
    }

    public Orientation getOrientation() {
        return orientation;
    }

    public void setOrientation(Orientation orientation) {
        this.orientation = orientation;
    }

    public int getPageWidth() {
        return pageWidth;
    }

    public void setPageWidth(int pageWidth) {
        this.pageWidth = pageWidth;
    }

    public int getPageHeight() {
        return pageHeight;
    }

    public void setPageHeight(int pageHeight) {
        this.pageHeight = pageHeight;
    }

    public int getMarginLeft() {
        return marginLeft;
    }

    public void setMarginLeft(int marginLeft) {
        this.marginLeft = marginLeft;
    }

    public int getMarginTop() {
        return marginTop;
    }

    public void setMarginTop(int marginTop) {
        this.marginTop = marginTop;
    }

    public int getMarginRight() {
        return marginRight;
    }

    public void setMarginRight(int marginRight) {
        this.marginRight = marginRight;
    }

    public int getMarginBottom() {
        return marginBottom;
    }

    public void setMarginBottom(int marginBottom) {
        this.marginBottom = marginBottom;
    }

    public String[] getAuthors() {
        return authors;
    }

    public void setAuthors(String[] authors) {
        this.authors = authors;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    @Override
    public PageSettings clone() {
        try {
            PageSettings c = (PageSettings) super.clone();
            
            if (authors != null){
                c.authors = authors.clone();
            }
            
            return c;
        } catch (CloneNotSupportedException e) {
            throw new RuntimeException(e);
        }
    }
    
}
